#pragma once
#ifndef Z3D_SHADERITEM_H
#define	Z3D_SHADERITEM_H

#include "ShaderItem.h"
#include "Log/LogSystem.h"
#include "core/core_utils.h"


namespace z3d{

    /**
     Represents an OpenGL program made by linking shaders.
     */
    class Program { 
    public:
        /**
         Creates a program by linking a list of tdogl::Shader objects
         
         @param shaders  The shaders to link together to make the program
         
         @throws std::exception if an error occurs.
         
         @see tdogl::Shader
         */
        Program(std::vector<z3d::ShaderItem>& shaders);
        ~Program();
        
        
        /**
         @result The program's object ID, as returned from glCreateProgram
         */
        GLuint object() const;
        
        
        /**
         @result The attribute index for the given name, as returned from glGetAttribLocation.
         */
        GLint attrib(const GLchar* attribName) const;
        
        
        /**
         @result The uniform index for the given name, as returned from glGetUniformLocation.
         */
        GLint uniform(const GLchar* uniformName) const;

        glog::CGlobalLog* _log;
    private:
        GLuint _object;
        
        //copying disabled
        Program(const Program&);
        const Program& operator=(const Program&);
    };

}

#endif //Z3D_SHADERITEM_H